package com.xyz.sms;

import java.util.HashMap;
import java.util.Map;

public class SmsUtils {

    private Map<SmsProvider,ISmsSender> smsSenders = new HashMap<>();

    private SmsUtils(){
        // 默认
        smsSenders.put(SmsProvider.Default,new DefaultSender());
    }

    private static class SmsUtilsHolder{
        public static final SmsUtils Instance = new SmsUtils();
    }

    public static SmsUtils getInstance(){
        return SmsUtilsHolder.Instance;
    }

    public  ISmsSender sender(){
        return sender(SmsProvider.Default);
    }

    public  ISmsSender sender(SmsProvider privider){
        return this.smsSenders.get(privider);
    }

    public enum SmsProvider{
        Baidu,Default
    }

}
